#include<iostream>
using namespace std;


int main()
{
    string s("aabb");
    int i = 0;
    int sum = 0;
    int tmp[300] = { 0 };
    while (s[i])
    {
        tmp[s[i++]] += 1;
    }
    i = 0;
    while (s[i])
    {
        if (tmp[s[i]] == 1)
        {
            sum = i;
            cout << sum << endl;
            break;
        }
        i++;
    }
   
    return 0;
}